package com.zy.mc_module.ui.micang.adapter;

import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.zy.mc_module.base.kotlin.BaseAdapter;
import com.zy.mc_module.base.kotlin.BaseViewHolder;
import com.zy.mc_module.databinding.ItemExpDetailBinding;
import com.zy.mc_module.mvp.bean.UserExperienceBean;

import java.util.List;

public class ExpDetailAdapter extends BaseAdapter<ItemExpDetailBinding, UserExperienceBean> {
    public ExpDetailAdapter(@NonNull List<UserExperienceBean> mData) {
        super(mData);
    }

    @NonNull
    @Override
    public ItemExpDetailBinding getViewBinding(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        return ItemExpDetailBinding.inflate(inflater,parent,false);
    }

    @Override
    protected void onMyBindViewHolder(@NonNull BaseViewHolder<ItemExpDetailBinding> holder, int position) {

        UserExperienceBean bean = getList().get(holder.getLayoutPosition());
        String[] type = {"永久","每日"};
        holder.getBinding().itemExpDay.setText(type[bean.getExperienceType() % 2]);
        holder.getBinding().itemExpName.setText(bean.getReason());
        holder.getBinding().itemExpTime.setText(bean.getCreateTime());
        holder.getBinding().itemExpNum.setText("+" + bean.getExperienceValue());
    }
}
